/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gridworld_v04;

import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *threads are stupid and/or ugly! this program wasn't designed with them in mind
 * @author Jonah
 */
public class IteratorThread extends Thread {
    private Game game;
    long miliseconds;
    int turns;

    public IteratorThread(Game game, long miliseconds, int turns) {
        this.game = game;
        this.miliseconds = miliseconds;
        this.turns = turns;
    }



    @Override
    public void run ()
    {
        for (int i = 0; i < turns; i++){
            System.out.println("start turn " + i);
            game.iterateTurn();
            try {
                sleep(miliseconds);
            } catch (InterruptedException ex) {
                //Logger.getLogger(IteratorThread.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        //this.
    }
}
